home *** CD-ROM | disk | FTP | other *** search
- var pState;
- var pX;
- var pY;
- var pNum;
- var pNum = Number(this._name.slice(6,-3));
- this.setPos = function(ty)
- {
- this._x = pX + 38;
- this._y = pY - ty;
- };
- this.activate = function()
- {
- var _loc1_ = this;
- trace("activated: " + pObj);
- _loc1_.pState = "active";
- _loc1_.gotoAndStop(_loc1_.pObj + "_active");
- };
- this.collect = function()
- {
- var _loc1_ = this;
- if(_loc1_.pState == "active")
- {
- _loc1_._parent.snd_mc.playsound("pFix");
- _loc1_.pState = "collected";
- _loc1_._parent.top_mc.addTarget();
- _loc1_._parent.obj_mc.activate();
- trace("collected: " + pObj);
- _loc1_.gotoAndStop(_loc1_.pObj + "_done");
- }
- };
- this.setUp = function(x, y, tobj)
- {
- var _loc1_ = this;
- _loc1_.pX = x * 16;
- _loc1_.pY = y * 16;
- _loc1_.pObj = tobj;
- _loc1_.gotoAndStop(tobj);
- };
- switch(pNum)
- {
- case 0:
- this.setUp(8,125,"screw");
- break;
- case 1:
- this.setUp(33,7,"fuse");
- break;
- case 2:
- this.setUp(31,53,"nozzle");
- break;
- case 3:
- this.setUp(12,56,"nut");
- break;
- case 4:
- this.setUp(37,83,"spring");
- }
- stop();
-